using System;
using cfg.item;
using UnityEngine;
using QFramework;

namespace QFramework.Monk
{
	public partial class GeneratorManager : ViewController
	{
		
		public static  GeneratorManager Default;
		private ResLoader mResLoader = ResLoader.Allocate();
		private void Awake()
		{
			Default = this;
		}

		private void OnDestroy()
		{
			Default = null;
			mResLoader.Recycle2Cache();
		}

		public void CreateDropItem(Vector3 pos, Item item)
		{
			GameObject itemObj = mResLoader.LoadSync<GameObject>(item.Prefab);
			if (itemObj!=null)
			{
				itemObj.InstantiateWithParent(GeneratorManager.Default.transform).Position(pos).Show();
				
			}
		}
		
	}
}
